package dmitrygusev.ratings.services;

import java.util.List;

import dmitrygusev.ratings.model.Movie;
import dmitrygusev.ratings.model.Rating;

public class TestSource extends AbstractSource {

	@Override
	public void fetchRawMovies(String query, List<Movie> result) {
		Movie movie;
		Rating rating;
		
		movie = new Movie();
		movie.setCode("code");
		movie.setSource(getName());
		movie.setTitle(query);
		movie.setTitle2(query);
		movie.setYear("2009");
		
		rating = new Rating();
		rating.setType("main");
		rating.setValue("5.12");
		rating.setVotes("40");

		movie.addRating(rating);

		result.add(movie);

		movie = new Movie();
		movie.setCode("code");
		movie.setSource(getName());
		movie.setTitle(query);
		movie.setTitle2(query);
		movie.setYear("2003");
		
		rating = new Rating();
		rating.setType("IMDB");
		rating.setValue("5.3");
		rating.setVotes("105");
		
		movie.addRating(rating);

		rating = new Rating();
		rating.setType("main");
		rating.setValue("4.11");
		rating.setVotes("50");
		
		movie.addRating(rating);
		
		result.add(movie);
	}

	@Override
	public String getName() {
		return "Test Site";
	}

	protected void fetchMovieDetails(Movie movie) {
	}

}
